<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>AJAX-TEST</title>

  </head>
  <body>


  <p> 输入:<input type="text" id="in" oninput="a()"></p>
  <p> 输出:<input type="text" id="out"></p>


  <script src="${pageContext.request.contextPath}/statics/js/jquery-3.5.1.js"></script>
  <script>
    function a(){
      $.ajax({
        url:"${pageContext.request.contextPath}/in",
        data:{"indata":$("#in").val()},
        success:(dataFromBackEnd,status)=>{
          $("#out").val(dataFromBackEnd+status);
        }
      });
    }
  </script>
  </body>
</html>
